package cn.wetcland.urban.framework.service.impl;

import cn.wetcland.urban.framework.mapper.UtDistrictMapper;
import cn.wetcland.urban.framework.mapper.UtOpenCityMapper;
import cn.wetcland.urban.framework.service.UtOpenCityService;
import cn.wetcland.urban.generator.domain.UtOpenCity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UtOpenCityServiceImpl extends ServiceImpl<UtOpenCityMapper, UtOpenCity> implements UtOpenCityService {

    @Resource
    public UtOpenCityMapper openCityMapper;

    @Resource
    public UtDistrictMapper districtMapper;

    @Override
    public boolean verifyOpenCityExist(Long cityId) {
        UtOpenCity utOpenCity = openCityMapper.selectOne(new QueryWrapper<UtOpenCity>().eq("city_id", cityId));
        return utOpenCity != null;
    }
}
